package com.fare.taluo.application.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.fare.taluo.core.domain.crawl.statistics.FailtureTaskEntity;
import com.fare.taluo.vo.core.FailtureTaskEntityVo;
import com.fare.taluo.application.FailtureTaskApplicaion;


@Transactional
@Scope("singleton")
@Service("failtureTaskApplicaion")
public class FailtureTaskApplicaionImpl implements FailtureTaskApplicaion{

	@Override
	public List<FailtureTaskEntityVo> getFailtureTaskByPage(int pageNum,
			int pageSize) {
		// TODO Auto-generated method stub
		try {
			FailtureTaskEntity fte = new FailtureTaskEntity();
			List<FailtureTaskEntity> listpo = fte.getFailtureTaskByPage(pageNum, pageSize);
			List<FailtureTaskEntityVo>listvo = new ArrayList<FailtureTaskEntityVo>();
			for(FailtureTaskEntity failtureTaskEntity : listpo){
				FailtureTaskEntityVo vo = new FailtureTaskEntityVo();
				vo.setGrabchannel(failtureTaskEntity.getGrabchannel());
				vo.setNum(failtureTaskEntity.getNum());
				vo.setGrabdate(failtureTaskEntity.getGrabdate());
				vo.setRemarks("");
				listvo.add(vo);
			}
			return listvo;
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	
		return null;
	}
	
}
